var site_url;
jQuery(document).ready(function(){
	
	jQuery( "#form-validate" ).validate({
				 rules:{
					'usr[_username]':{ required: true,email: true, "remote":{url: site_url+'/vendedor/validarNombreUsuario',
																			 type: "post",
																			 data:{
																				 email: function(){
																					 return jQuery('#form-validate :input[name="usr[_username]"]').val();
																					}
																				}
																			}
									 },
					'usr[_password]': {required: true,minlength: 5},
					'contra': {required: true, equalTo: "#pass"},
				 },
				 messages:{
					 'usr[_username]': {remote: jQuery.validator.format("{0} ya está registrado.")},
					 'usr[_password]': {minlength: "Minimo 5 caracteres"},
					 'contra': {equalTo: "Los campos no coinciden"}
				 }
	});
		
});
